Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrNhatKyMuaHang
    ' Private matk, tentk As String
    Private thangnam As Date
    Private customerReport As ReportDocument

    Private Sub FrmCrNhatKyMuaHang_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        Dim sqlQuery As String = "SELECT t.*, t.ngay as ngayCT from tbl_dot_temp_nhatky_muahang as t ORDER BY t.ngay"
        Dim reportPath = Application.StartupPath & "\" & "crNhatKyMuaHang.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        'customerReport.SetParameterValue("TMatk", matk)
        'customerReport.SetParameterValue("TTentk", tentk)
        customerReport.SetParameterValue("TThangnam", thangnam)
        customerReport.SetParameterValue("ketoantruong", globalVariale.KETOANTRUONG)
        customerReport.SetParameterValue("giamdoc", globalVariale.TONGGIAMDOC)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub
    'Public Sub setMatk(ByVal s As String)
    '    matk = s
    'End Sub
    'Public Sub setTentk(ByVal s As String)
    '    tentk = s
    'End Sub

    Public Sub setThangnam(ByVal s As Date)
        thangnam = s
    End Sub
End Class
